package per.jdz.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.SessionAttribute;
import per.jdz.entity.RestBean;
import per.jdz.entity.user.AccountUser;

/**
 * ClassName: UserController
 * Description:
 *
 * @Author: jdz
 * @Create: 2023/4/21 - 23:20
 */
@RestController
@RequestMapping("/api/user")
public class UserController {
    /**
     * 从 session 中获取名为 "account" 的属性，并将其绑定到 User 类型的参数上
     * @param user
     * @return
     */
    @GetMapping("/me")
    public RestBean<AccountUser> me(@SessionAttribute("account") AccountUser user) {
        return RestBean.success(user);
    }


}
